import java.lang.annotation.*;
import java.util.Arrays;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<Class> animalClasses = Arrays.asList(Cat.class, Dog.class, Pig.class, Tiger.class);
        // 找到 所有的包含@Flag注解的类，打印注解中的value属性值
        for (Class animalClass : animalClasses) {
            if (animalClass.isAnnotationPresent(Flag.class)){
                Flag annotation= (Flag) animalClass.getAnnotation(Flag.class);
                System.out.println(annotation.value());
            }
        }
    }
}

@Flag("cat")
class Cat implements Animal{
}
@Flag("dog")
class Dog implements Animal{
}
class Pig implements Animal{
}
class Tiger implements Animal{
}
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@interface Flag {
    String value() default "";
}

interface Animal{

}